package com.zxk.version3.provider;


import com.zxk.version3.api.UserService;
import com.zxk.version3.core.User;

import java.util.Random;
import java.util.UUID;

/**
 * @author 朱小康
 */
public class UserServiceImpl implements UserService {
    @Override
    public User getUserByUserId(Integer id) {
        Random random = new Random();
        System.out.println("客户端查询了"+id+"的用户");
        User user = User.builder().userName(UUID.randomUUID().toString())
                .id(id)
                .sex(random.nextBoolean()).build();
        return user;
    }

    @Override
    public Integer insertUser(User user) {
        System.out.println("插入数据成功："+user);
        return 1;
    }
}
